#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2018/1/31 22:16
# @Author  : Aries
# @Site    : 
# @File    : utils.py
# @Software: PyCharm Community Edition

def str2Float(strVal, errVal=None):
    strVal = str(strVal).strip()
    # print("IN: " + strVal)
    outFloat = 0.0
    try:
        outFloat = float(strVal)
    except ValueError:
        if not errVal is None:
            outFloat = float(errVal)
        else:
            raise ARCSIException("could not convert string to float: \'" + strVal + '\'.')
    # print("Out: " + str(outFloat))
    return outFloat